﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class Program
    {
       
        static void Main(string[] args)
        {
           
            student stu = new student();
            ArrayList list = new ArrayList();



            while (true)
            {
                Console.WriteLine("选择：1.输入，2.退出");
                int num = int.Parse(Console.ReadLine());
                if (num==1)
                {


                    try
                    {

                        Console.WriteLine("请输入分数");
                        int a = int.Parse(Console.ReadLine());
                        student stu4 = new student(a);
                        list.Add(stu4);


                    }
                  
                    catch (OverflowException)
                    {
                        Console.WriteLine("已捕获异常");

                    }
                    catch (System.FormatException)
                    {
                        Console.WriteLine("已捕获异常");

                    }
                    catch (Exception)
                    {
                        Console.WriteLine("以捕获异常");
                    }




                }
                else
                {
                    break;
                }
                
            }


            for (int i = 0; i < list.Count; i++)
            {
                student st = (student)list[i];
                Console.WriteLine("成绩:{0}", st.Id);
            }













        }

        
           
           
        






    }
}
